# import requests
#
# def send_bark_notification(title, content):
#     bark_key = 'wXMCSCnZVj8NtsKzbjYrq7'
#     custom_icon_url = './custom_icon.jpg'
#     request_url = f"https://api.day.app/{bark_key}/{title}/{content}&icon={custom_icon_url}"
#     response = requests.get(request_url)
#     if response.status_code == 200:
#         print("Bark notification sent successfully!")
#     else:
#         print("Failed to send Bark notification.")
#
# # 调用发送 Bark 推送消息的函数
# send_bark_notification("Test Notification", "This is a test notification from Python script.")
import requests

def send_bark_notification():
    bark_key = 'wXMCSCnZVj8NtsKzbjYrq7'
    url = f"https://api.day.app/{bark_key}"
    headers = {
        'Content-Type': 'application/json; charset=utf-8'
    }
    data = {
        "body": "https://mritd.com",
        "title": "Test Title",
        "badge": 1,
        "category": "myNotificationCategory",
        "sound": "minuet.caf",
        "icon": "https://img.zcool.cn/community/015f60581f1f89a84a0e282bbe8d15.png@3000w_1l_2o_100sh.png",
        "group": "test",
        "url": "💬https://mritd.com"
    }
    response = requests.post(url, headers=headers, json=data)
    if response.status_code == 200:
        print("Bark notification sent successfully!")
    else:
        print("Failed to send Bark notification.")

# 调用发送 Bark 推送消息的函数
send_bark_notification()
